<?php
/**
 * User: shutao
 * @var View $this
 */

use wechat\models\WeContent;
use yii\web\View;

$this->title = '智能回复内容列表';
$model = new WeContent();
?>
<div ng-controller="contentIndexCtrl">
    <div class="xblock">
        <button class="layui-btn layui-btn-xs" ng-click="toEdit(0)">
            <i class="icon iconfont layui-extend-add"></i> 添加内容
        </button>
        <span class="x-right">共有数据：<span><span ng-bind="pagination.itemsCount">0</span> 条</span></span>
    </div>

    <table class="layui-table"  style="text-align: center;">
        <tr>
            <th style="width: 50px;">ID</th>
            <th style="width: 80px;"><?php echo $model->getAttributeLabel('type') ?></th>
            <th style="width: 200px;"><?php echo $model->getAttributeLabel('title') ?></th>
            <th style="width: 200px;"><?php echo $model->getAttributeLabel('keyword') ?></th>
            <th style="width: 60px;">操作</th>
            <th></th>
        </tr>

        <tr ng-repeat="x in datas">
            <td><span ng-bind="x.id"></span></td>
            <td><span ng-bind="x.type_text"></span></td>
            <td><span ng-bind="x.title"></span></td>
            <td><span ng-bind="x.keyword"></span></td>
            <td>
                <button ng-click="toEdit(x,$index)" title="编辑"
                        class="layui-btn layui-btn-xs layui-btn-warm"><i class="layui-icon">&#xe642;</i>
                </button>
                <button ng-click="toDelete(x,$index)" title="删除"
                        class="layui-btn layui-btn-xs layui-btn-danger"><i class="layui-icon">&#xe640;</i>
                </button>
            </td>
            <td></td>
        </tr>
    </table>
    <div pagination="pagination" class="pagination"></div>
</div>
<input name="_csrf" type="hidden" id="_csrf" value="<?= \Yii::$app->request->csrfToken ?>">